home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS in a Box 7
/
BBS in a Box - Macintosh - Volume VII (BBS in a Box) (January 1993).iso
/
Files
/
MacII
/
H-L
/
JuliaSet 5.1b0.cpt
/
JuliaSet.a
next >
Wrap
Text File
|
1988-04-08
|
21KB
|
852 lines
;
; fractal xcmd v0.3 -- Doug Felt, Oct 14, 1987
;
; This draws a fractal on the screen. Not to the card, yet. Function is
; f(z) = z * z + c, julia set mapped to 4 patterns.
;
; Format:
; Fractal seed.h seed.v [res = 8 [limit = 32 [lock = 0]]]
;
; seed is the complex constant c (v imaginary)
; res is the number of pixels on a side for the point to plot
; limit is the max number of iterations (best between 16 & 128, multiple of 4),
; lower limit means most complex regions of the fractal are white
; if lock is 0, pressing the mouse will immediately stop the drawing, otherwise
; pressing the mouse has no effect and drawing can only be stopped by reboot or
; fancy macsbug work.
;
; Doug Felt, AIR/CAT Project
; duggie@jessica.stanford.edu
;
;
; To compile and link in MPW C:
;
; C -q2 Fractal.c
; link -sn Main=Fractal -sn STDIO=Fractal ∂
; -sn INTENV=Fractal -rt XCMD=104 ∂
; -m FRACTAL Fractal.c.o "{CLibraries}CRunTime.o" ∂
; -o HyperCommands
;
;
;
; Fractal3 xcmd v3.0 -- Ray Sanders, Nov 7, 1987
;
; Well now, I thought this was so neat, and Doug was right it needs a
; little more speed. So thats what I did, I rewrote the "C" program in
; assembler with direct processing on the MC68881 FPU. I think this makes
; quite a difference. The only thing is that it only runs on a MacII. It
; might run on one or more of the accelerator cards. Give it a try. If
; necessary, change the COID= parameter below if they are using other than 1.
;
; Ray Sanders
; Green Grass Software, Inc.
;
; CIS: 70277,3233 GEnie: RAYSANDERS
;
; To assemble and link with MPW:
;
; fractal3.a.o ƒ fractal3.make fractal3.a
; Asm fractal3.a -l -font Monaco,9
; fractal3 ƒ fractal3.make fractal3.a.o
; link -o fractal3 -rt XCMD=106 -sn Main=Fractal3 -t STAK -c WILD ∂
; fractal3.a.o ∂
; -o "Fractals"
;
;
;
; Fractal5 -- Ray Sanders, Nov 15, 1987
;
; OK, so HyperCard was a trip. But when you have to run it on the Mac II
; you might as well have the color. And we do.
;
; Ray Sanders
; Green Grass Software, Inc.
;
; CIS: 70277,3233 GEnie: RAYSANDERS
;
; To assemble and link with MPW:
;
; # Target: fractal5
; # Sources: fractal5.a fractal5.r
; # Created: Saturday, November 14, 1987 11:26:53 PM
;
; fractal5.a.o ƒ fractal5.make fractal5.a
; Asm fractal5.a -font Monaco,9
; fractal5 ƒƒ fractal5.make fractal5.r
; Rez fractal5.r -append -o fractal5
; fractal5 ƒƒ fractal5.make fractal5.a.o
; Link -w -t APPL -c '????' ∂
; fractal5.a.o ∂
; "{Libraries}"Interface.o ∂
; "{Libraries}"Runtime.o ∂
; -o fractal5
;
;
; INCLUDE 'Traps.a'
; INCLUDE 'SysEqu.a'
; INCLUDE 'QuickEqu.a'
; INCLUDE 'ToolEqu.a'
; INCLUDE 'PaletteEqu.a'
PRINT OFF
INCLUDE 'Traps.a'
INCLUDE 'SysEqu.a'
INCLUDE 'QuickEqu.a'
INCLUDE 'ToolEqu.a'
INCLUDE 'PaletteEqu.a'
PRINT ON,NOWARN
; PRINT ON
BLANKS OFF ; allow comments without semicolons
Point RECORD 0 Point = RECORD CASE INTEGER OF
v DS.W 1 1: (v: INTEGER;
h DS.W 1 h: INTEGER);
ORG v 2: (vh: ARRAY[1..2]
vh DS.W h OF INTEGER)
ENDR END;
Rect RECORD 0 Rect = RECORD CASE INTEGER OF
top DS.W 1 1: (top: INTEGER;
left DS.W 1 left: INTEGER;
bottom DS.W 1 bottom: INTEGER;
right DS.W 1 right: INTEGER);
ORG top
topLeft DS.L Point 2: (topLeft: Point;
botRight DS.L Point 3: (botRight: Point)
ENDR END;
BitMap RECORD 0 BitMap = RECORD
baseAddr DS.L 1 baseAddr: QDPtr;
rowBytes DS.W 1 rowBytes: INTEGER;
bounds DS.L Rect bounds: Rect
ENDR END;
EventRecord RECORD 0 EventRecord = RECORD
what DS.W 1 what: INTEGER;
message DS.L 1 message: LONGINT;
when DS.L 1 when: LONGINT;
where DS.L Point where: Point;
modifiers DS.W 1 modifiers: INTEGER
ENDR END;
EJECT
***********************
* QuickDraw's Globals *
***********************
* The following data module is used to define the QuickDraw global data area.
* -----------
QuickDraw RECORD ,DECREMENT
thePort DS.L 1
white DS.B 8
black DS.B 8
gray DS.B 8
ltGray DS.B 8
dkGray DS.B 8
arrow DS.B cursRec
screenBits DS.B BitMap
randSeed DS.L 1
ORG -grafSize
ENDR
fractal5 MAIN
BLANKS ON
STRING ASIS
MC68881 COID=1,PREC=X,ROUND=N
true EQU 1
; definition of stack frame
stackStor RECORD 0,DECREMENT
stackStorStart EQU *
hsize DS.W 1
vsize DS.W 1
i DS.W 1
j DS.W 1
iter DS.W 1
rbaseh DS.W 1
rat DS.L 3
valh DS.L 3
valv DS.L 3
temp DS.L 3
basev DS.L 3
baseh DS.L 3
hsq DS.L 3
vsq DS.L 3
real100 DS.L 3
fake256 DS.L 1
fake171 DS.L 1
fake2 DS.L 1
fake100 DS.L 1
r DS.W 4
tempX DS.L 3
tempBig DS.B 520
tempBig2 DS.B 520
tempL DS.L 1
srcBM DS.W 7
dstR DS.W 4
CurPort DS.L 1
ourWindPtr DS.L 1
ourPixMap DS.L 1
watchCursorHand DS.L 1
ourDlogPtr DS.L 1
itemHitInt DS.W 1
dummyRect DS.W 4
itemHandle DS.L 1
dummyType DS.W 1
packedData DS.L 3
seedH DS.L 3
seedV DS.L 3
limit DS.W 1
evtRecd DS.L 4
stackStorLen EQU *-stackStorStart
ENDR
WITH stackStor,QuickDraw
EntryPoint
;;; _Debugger ;
MOVEM.L A0-A6/D0-D7,-(SP) ;
LINK A6,#stackStorLen ;
PEA thePort ; Initialize QuickDraw
_InitGraf
_InitFonts ; Initialize Font Manager
MOVE.L #$0000FFFF,D0 ; Discard any previous events
_FlushEvents ; FlushEvents(EventEvent, 0);
_InitWindows ; Initialize Window Manager
_InitMenus ; Initialize Menu Manager
_TEInit ; Initialize TextEdit
CLR.L -(A7) ; Initialize Dialog Manager
_InitDialogs ; InitDialogs(NIL);
_InitCursor ; Make cursor an arrow
_InitPalettes ; crank up pallette manager
; ; res = 1
; ; limit = 64
; ; nolock = 1
;;; _Debugger
CLR.L -(SP) ; result
MOVE.W #4,-(SP) ; cursor type
_GetCursor ; get handle to it
MOVE.L (SP)+,watchCursorHand(A6) ; and save it
CLR.L -(SP) ; result
MOVE.L #'scrn',-(SP) ; resource type
MOVE.W #0,-(SP) ; resource #
_GetResource ; get screen resource
MOVE.L (SP)+,A0 ; get resource handle
MOVE.L (A0),A0 ; de-ref it
MOVE.W (A0)+,D0 ; count of screens
@010
BTST.B #3,12(A0) ; is this the main screen ?
BNE.S @040 ; yes
ADDA.L #26,A0 ; pt to ctl call field
MOVE.W (A0)+,D1 ; get count of ctl calls
BEQ.S @030 ; none
@020
ADDQ.L #8,A0 ; skip ctl call
SUBQ.W #1,D1 ; sub 1 from count
BNE.S @020 ; more
@030
SUBQ.W #1,D0 ; sub 1 from count
BNE.S @010 ; more
BRA FracsDone ; could not find main screen
@040
CMPI.W #130,8(A0) ; 16 colors ?
BEQ.S @050 ; yes
CMPI.W #131,8(A0) ; 256 colors ?
BEQ.S @050 ; yes
CLR.W -(SP) ; result
MOVE.W #128,-(SP) ; 'ALRT' id
CLR.L -(SP) ; no filter proc
_StopAlert ; tell why were not running
ADDQ.L #2,SP ; don't care
BRA FracsDone ; not enough colors
@050
CLR.L -(SP) ; DialogPtr
MOVE.W #130,-(SP) ; dialogID
CLR.L -(SP) ; dStorage
MOVE.L #-1,-(SP) ; behind
_GetNewDialog ;
MOVE.L (SP)+,ourDlogPtr(A6) ;
MOVE.L ourDlogPtr(A6),-(SP) ; DialogPtr
_SetPort ;
MOVE.L ourDlogPtr(A6),-(SP) ; DialogPtr
MOVE.W #1,-(SP) ; itemNo
PEA.L dummyType(A6) ; VAR itemType
PEA.L itemHandle(A6) ; VAR item
PEA.L dummyRect(A6) ; VAR itemRect
_GetDItem ;
MOVE.L #$00030003,-(SP) ; v & h
_PenSize ;
PEA.L dummyRect(A6) ;
MOVE.L #$FFFCFFFC,-(SP) ; V & H
_InsetRect ;
PEA.L dummyRect(A6) ;
MOVE.L #$00100010,-(SP) ; V & H
_FrameRoundRect ;
MOVE.W #3,D0 ;
@055
MOVE.L ourDlogPtr(A6),-(SP) ; DialogPtr
MOVE.W D0,-(SP) ; itemNo
MOVE.W #0,-(SP) ; strtSel
MOVE.W #32767,-(SP) ; endSel
_SelIText
CLR.L -(SP) ; filterProc
PEA.L itemHitInt(A6) ; VAR itemHit
_ModalDialog ;
CMPI.W #1,itemHitInt(A6) ;
BEQ.S @060 ;
MOVE.L ourDlogPtr(A6),-(SP) ;
_DisposDialog ;
BRA FracsDone ;
@060
MOVE.W #3,D0 ;
BSR GetFieldRtn ;
BSR ConvertFieldRtn ;
BEQ @065 ;
MOVE.W #3,D0 ;
BRA.S @055 ;
@065
FMOVE.X FP0,seedH(A6) ; get result
MOVE.W #4,D0 ;
BSR GetFieldRtn ;
BSR ConvertFieldRtn ;
BEQ @070 ;
MOVE.W #4,D0 ;
BRA.S @055 ;
@070
FMOVE.X FP0,seedV(A6) ;
MOVE.W #5,D0 ;
BSR GetFieldRtn ;
BSR ConvertFieldRtn ;
BEQ @075 ;
MOVE.W #5,D0 ;
BRA.S @055 ;
@075
FMOVE.W FP0,limit(A6) ;
MOVE.L ourDlogPtr(A6),-(SP) ;
_DisposDialog ;
@100
CLR.L -(SP) ; WindowPtr
CLR.L -(SP) ; wStorage
PEA.L bRect ; boundsRect
PEA.L wTitle ; wTitle
MOVE.B #true,-(SP) ; visible
MOVE.W #noGrowDocProc,-(SP) ; procID
MOVE.L #-1,-(SP) ; behind
MOVE.B #true,-(SP) ; goAwayFlag
CLR.L -(SP) ; refCon
_NewCWindow ;
MOVE.L (SP),ourWindPtr(A6) ;
_SetPort ;
CLR.L -(SP) ; PixMapHandle
_NewPixMap ;
MOVE.L (SP)+,ourPixMap(A6) ;
MOVE.L ourWindPtr(A6),A0 ;
MOVE.L portPixMap(A0),-(SP) ; get handle to cGrafPort pix map
MOVE.L ourPixMap(A6),-(SP) ; our pix map
_CopyPixMap ; copy (to get color table)
MOVE.L ourPixMap(A6),A0 ; get handle
MOVE.L (A0),A0 ; de-ref it
MOVE.L pmTable(A0),-(SP) ; get c-tab handle
_DisposCTable ; release prev table
CLR.L -(SP) ; result
MOVE.W #128,-(SP) ; 'clut' ID number
_GetCTable ; get our table
MOVE.L (SP),A0 ; our tables new handle
MOVE.L A0,-(SP) ; resource to detach
_DetachResource ; disco it
MOVE.L ourPixMap(A6),A0 ; get handle
MOVE.L (A0),A0 ; de-ref it
MOVE.L (SP)+,pmTable(A0) ; set new table
MOVE.L watchCursorHand(A6),A0 ; handle
_HLock ; hang on to it
MOVE.L watchCursorHand(A6),A0 ; handle
MOVE.L (A0),-(SP) ; ptr
_SetCursor ; let's do the wait thing
MOVE.L watchCursorHand(A6),A0 ; handle
_HUnlock ; free it
; /* map screen onto -2 to 2 range */
;
; /* 0,0 is at 512/2, 342/2 = 256,171 */
;
; /* gridding to res requires that I find out how many boxes wide and tall
; the image is, and map each box onto a value in r2. then i iterate over
; all the boxes calling the function until the x or y exceeds some limit.
; then i map the number of iterations into a 'color' */
;
; /* since we don't have a global data area for extended constants to live in,
; use longs and fake the compiler into making the correct SANE calls to
; build the extended values. Is there a better way (besides using Pascal!) */
;
CLR.L D0 ;
MOVE.W bRect+6,D0 ; get right
SUB.W bRect+2,D0 ; sub left
ADDQ.W #1,D0 ;
LSR.L #1,D0 ; divide by 2
MOVE.L D0,fake256(A6) ;
CLR.L D0 ;
MOVE.W bRect+4,D0 ; get bottom
SUB.W bRect,D0 ; sub top
ADDQ.W #1,D0 ;
LSR.L #1,D0 ; divide by 2
MOVE.L D0,fake171(A6) ;
MOVE.L #2,fake2(A6) ; fake2 = 2
MOVE.L #100,fake100(A6) ; fake100 = 100
MOVE.L fake256(A6),D0 ; hsize = (fake256/res)+1
DIVS.W res,D0 ;
ADDQ.W #1,D0 ;
MOVE.W D0,hsize(A6) ;
MOVE.L fake171(A6),D0 ; vsize = (fake171/res)+1
DIVS.W res,D0 ;
ADDQ.W #1,D0 ;
MOVE.W D0,vsize(A6) ;
FMOVECR.X #$34,FP0 ; real100 = fake100
FMOVE.X FP0,real100(A6) ;
; ; real2 = fake2
; ; realn2 = -fake2
FMOVE.X real2,FP0 ; rat = real2/hsize
FDIV.W hsize(A6),FP0 ;
FMOVE.X FP0,rat(A6) ; /* reals intermediate result because of real2 */
MOVE.W res,D0 ; rbaseh = 256-hsize*res
MULS.W hsize(A6),D0 ;
MOVE.L fake256(A6),D1 ;
SUB.W D0,D1 ;
MOVE.W D1,rbaseh(A6) ;
MOVE.W res,D0 ; r.top = 171-vsize*res
MULS.W vsize(A6),D0 ;
MOVE.L fake171(A6),D1 ;
SUB.W D0,D1 ;
MOVE.W D1,r(A6) ;
ADD.W res,D1 ; r.bottom = r.top + res
MOVE.W D1,r+4(A6) ;
FMOVE.L fake171(A6),FP2 ; basev = realn2*fake171/fake256
FMUL.X realn2,FP2 ; /* center it */
FDIV.L fake256(A6),FP2 ;
FMOVE.X seedv(A6),FP0 ;
FMOVE.X seedh(A6),FP1 ;
; for loop
MOVE.W vsize(A6),D4 ; for (i=-vsize; i<vsize; ++i)
NEG.W D4 ;
@200
;;; CMP.W vsize(A6),D4 ;
CMPI.W #0,D4 ;
BGE @502 ;
MOVE.W rbaseh(A6),D0 ; r.left = rbaseh
MOVE.W D0,r+2(A6) ;
ADD.W res,D0 ; r.right = r.left + res
MOVE.W D0,r+6(A6) ;
CLR.W -(SP) ; check if this line is visible
MOVE.L r(A6),-(SP) ;
MOVE.L ourWindPtr(A6),A0 ;
MOVE.L contRgn(A0),-(SP) ;
_PtInRgn ;
TST.W (SP)+ ;
BNE @470 ;
FMOVE.X realn2,FP3 ; baseh = realn2
; for loop
MOVE.W hsize(A6),D3 ; for (j=-hsize; j<hsize; ++j)
NEG.W D3 ;
@250
CMP.W hsize(A6),D3 ;
BGT @450 ;
FMOVE.X FP3,FP5 ; valh = baseh
FMOVE.X FP2,FP4 ; valv = basev
CLR.W D5 ; iter = 0
; do loop
@300
;
;
; register assignments to speed up loop
;
; hsq is in FP7
; vsq is in FP6
; valh is in FP5
; valv is in FP4
; baseh is in FP3
; basev is in FP2
; seedh is in FP1
; seedv is in FP0
;
FMOVE.X FP4,FP6 ; vsq = valv * valv
FMUL.X FP4,FP6 ;
FMUL.X FP5,FP4 ; valv = real2*valh*valv + seedv
FADD.X FP4,FP4 ;
FADD.X FP0,FP4 ;
FMUL.X FP5,FP5 ; hsq = valh * valh
FMOVE.X FP5,FP7 ;
FSUB.X FP6,FP5 ; valh = hsq - vsq + seedh
FADD.X FP1,FP5 ;
ADDQ.W #1,D5 ; ++iter
FADD.X FP6,FP7 ; while ((hsq+vsq<real100) && (iter<limit))
FMOVE.X sCons,FP6 ; <<<<< this one brings in a constant from 68020
;;; FMOVECR.X #$34,FP6 ; <<<<< this one uses X'100.0' from 68881 ROM
FCMP.X FP7,FP6 ;
FBLE.W @350 ;
CMP.W limit(A6),D5 ;
BLE @300 ;
@350
FADD.X rat(A6),FP3 ; baseh += rat
MOVE.W r+2(A6),D2 ; get left pixel #
SUB.W rbaseh(A6),D2 ; make rel to zero
ANDI.W #-8,D2 ; got long word #
LSR.W #1,D2 ; divide by 2 ( get's displ)
LEA.L tempBig(A6),A1 ; get base
ADDA.W D2,A1 ; pt to line
ANDI.L #15,D5 ;
MOVE.W r+2(A6),D0 ; get left pixel #
SUB.W rbaseh(A6),D0 ; make rel to zero
MOVEQ.L #7,D2 ;
AND.W D2,D0 ; take mod 4
BNE.S @447 ; no
CLR.L (A1) ; clear the word
@447
SUB.W D0,D2 ;
CLR.L D0 ;
LSL.W #2,D2 ; mult by 4
LSL.L D2,D5
OR.L D5,(A1) ; set pixel relative value
MOVE.W res,D0 ; r.left += res
ADD.W D0,r+2(A6) ;
ADD.W D0,r+6(A6) ; r.right += res
ADDQ.W #1,D3 ;
BRA @250 ;
@450
;;; _Debugger
FADD.X rat(A6),FP2 ; basev += rat
MOVE.L ourPixMap(A6),A2 ; get pixMap handle
MOVE.L (A2),A2 ; de-ref it
LEA.L tempBig(A6),A0 ; pt to bit area
MOVE.L A0,pmBaseAddr(A2) ; set it
MOVE.W #512,pmRowBytes(A2) ; set rowBytes
ORI.B #$80,pmNewFlag(A2) ; indicate new pix map
MOVE.W #4,pmPixelSize(A2) ; set bits per pixel
MOVE.W #4,pmCmpSize(A2) ; set bits per pixel
MOVE.W #0,dstR+2(A6) ; set left
MOVE.W bRect+6,D0 ; get right
SUB.W bRect+2,D0 ; find diff
MOVE.W D0,dstR+6(A6) ; set right
MOVE.W r(A6),D0 ; get top
MOVE.W D0,dstR(A6) ; set top
ADD.W #1,D0 ;
MOVE.W D0,dstR+4(A6) ; set bottom
MOVE.L dstR(A6),pmBounds(A2) ;
MOVE.L dstR+4(A6),pmBounds+4(A2) ;
MOVE.L ourPixMap(A6),A0 ;
MOVE.L (A0),-(SP) ;
MOVE.L ourWindPtr(A6),A0 ; get ptr to port
MOVE.L portPixMap(A0),A0 ; dest bitmap
MOVE.L (A0),-(SP) ;
PEA.L dstR(A6) ;
PEA.L dstR(A6) ;
MOVE.W #srcCopy,-(SP) ;
CLR.L -(SP) ;
_CopyBits
@460
CLR.L D6 ;
MOVE.W bRect+6,D6 ; get right
SUB.W bRect+2,D6 ; find diff
ADDQ.L #2,D6 ;
CLR.L D7 ;
MOVE.L D6,D0 ;
ANDI.L #-8,D0 ;
LSR.L #1,D0 ;
LEA.L tempBig2(A6),A0 ;
ADDA.L D0,A0 ; pt to recv word
CLR.L (A0) ;
@462 ;
LEA.L tempBig(A6),A0 ;
MOVE.L D7,D0 ;
ANDI.L #-8,D0 ;
LSR.L #1,D0 ;
ADDA.L D0,A0 ;
MOVE.L D7,D0 ;
ANDI.L #7,D0 ;
LSL.L #2,D0 ;
MOVE.L (A0),D1 ;
LSL.L D0,D1 ;
ANDI.L #$F0000000,D1 ; save our nible
MOVE.L D6,D0 ;
SUB.L D7,D0 ;
MOVE.L D0,D2 ; make a copy
ANDI.L #-8,D0 ;
LSR.L #1,D0 ;
LEA.L tempBig2(A6),A0 ;
ADDA.L D0,A0 ; pt to recv word
ANDI.L #7,D2 ;
CMPI.L #7,D2 ;
BNE.S @464 ;
CLR.L (A0) ;
@464 ;
LSL.L #2,D2 ;
LSR.L D2,D1 ;
OR.L D1,(A0) ;
CMP.W D6,D7 ;
BGT.S @466 ;
ADDQ.L #1,D7 ;
BRA @462 ;
@466
MOVE.L ourPixMap(A6),A2 ; get pixMap handle
MOVE.L (A2),A2 ; de-ref it
LEA.L tempBig2(A6),A0 ; pt to bit area
MOVE.L A0,pmBaseAddr(A2) ; set it
MOVE.W bRect+4,D1 ; get bottom
SUB.W bRect,D1 ; find diff
SUB.W r(A6),D1 ; get top
MOVE.W D1,dstR(A6) ; set top
ADD.W #1,D1 ;
MOVE.W D1,dstR+4(A6) ; set bottom
MOVE.L dstR(A6),pmBounds(A2) ;
MOVE.L dstR+4(A6),pmBounds+4(A2) ;
MOVE.L ourPixMap(A6),A0 ;
MOVE.L (A0),-(SP) ;
MOVE.L ourWindPtr(A6),A0 ; get ptr to port
MOVE.L portPixMap(A0),A0 ; dest bitmap
MOVE.L (A0),-(SP) ;
PEA.L dstR(A6) ;
PEA.L dstR(A6) ;
MOVE.W #srcCopy,-(SP) ;
CLR.L -(SP) ;
_CopyBits
@470
MOVE.W res,D0 ; r.top += res
ADD.W D0,r(A6) ;
ADD.W D0,r+4(A6) ; r.bottom += res
SUBQ.L #2,SP ; result
MOVE.W #$2a,-(SP) ; eventMask
PEA.L evtRecd(A6) ; VAR theEvent
_GetNextEvent ;
TST.B (SP)+ ; any event ?
BNE PitchWindow ; yes
@475
ADDQ.W #1,D4 ;
BRA @200 ;
@502
SUBQ.L #2,SP ; result
MOVE.W #$2a,-(SP) ; eventMask
PEA.L evtRecd(A6) ; VAR theEvent
_GetNextEvent ;
TST.B (SP)+ ; any event ?
BEQ @502 ; yes
PitchWindow
MOVE.L ourWindPtr(A6),-(SP) ;
_DisposWindow ; get rid of it
FracsDone
_InitCursor
CLR.L -(SP) ; result
MOVE.W #129,-(SP) ; dlog ID
CLR.L -(SP) ; dStorage
MOVE.L #-1,-(SP) ; behind
_GetNewDialog ; show it
MOVE.L (SP),-(SP) ; copy it
_DrawDialog ; and draw it
MOVE.L #60,A0 ; numticks
_Delay
_DisposDialog ;
UNLK A6
MOVEM.L (SP)+,A0-A6/D0-D7 ; restore registers
_ExitToShell
GetFieldRtn
MOVE.L ourDlogPtr(A6),-(SP) ; DialogPtr
MOVE.W D0,-(SP) ; itemNo
PEA.L dummyType(A6) ; VAR itemType
PEA.L itemHandle(A6) ; VAR item
PEA.L dummyRect(A6) ; VAR itemRect
_GetDItem ;
MOVE.L itemHandle(A6),-(SP) ; item
PEA.L tempBig(A6) ; VAR text
_GetIText ;
RTS ;
ConvertFieldRtn
CMP.B #10,tempBig(A6) ;
BGT @850 ;
CLR.L D7 ; clear sign reg
LEA.L tempBig(A6),A0 ;
CLR.L D0 ;
MOVE.L #-1,D1 ;
CLR.L D2 ;
MOVE.B (A0)+,D2 ; get string length
CLR.L D3 ;
CMPI.B #'-',(A0) ; do we start with a neg ?
BNE.S @100 ; no
MOVE.L #$80000000,D7 ; mask for later or'ing
ADDQ.L #1,A0 ;
SUBQ.L #1,D2 ;
@100
CMPI.B #'.',(A0) ; seperator ?
BEQ @190 ; yes
CMPI.B #$30,(A0) ; check nums
BLT @850 ; bad
CMPI.B #$39,(A0) ; check nums
BGT @850 ;
MOVE.B (A0)+,D3 ;
ANDI.L #15,D3 ;
LSL.L #4,D0 ; make room
OR.L D3,D0 ; copy over
SUBQ.L #1,D2 ;
BNE.S @100 ; loop if more
BRA @300 ;
@190
ADDQ.L #1,A0 ;
SUBQ.L #1,D2 ;
BEQ @300 ;
@200
CMPI.B #$30,(A0) ; check nums
BLT @850 ; bad
CMPI.B #$39,(A0) ; check nums
BGT @850 ;
MOVE.B (A0)+,D3 ;
ANDI.L #15,D3 ;
LSL.L #4,D1 ; make room
OR.L D3,D1 ; copy over
SUBQ.L #1,D2 ;
BNE.S @200 ; loop if more
@300
MOVE.L D1,D3 ; copy it
ANDI.L #$F0000000,D3 ; check upper nibble
CMPI.L #$F0000000,D3 ; is it unused ?
BNE.S @400 ; yes
LSL.L #4,D1 ; up it a digit
BRA.S @300 ;
@400
MOVE.L #$00080000,packedData(A6) ; set scaling factor
OR.L D7,packedData(A6) ; set sign bit
MOVE.L D0,packedData+4(A6) ;
MOVE.L D1,packedData+8(A6) ;
FMOVE.P packedData(A6),FP0 ;
CLR.L D2 ;
RTS ;
@850
MOVEQ.L #-1,D2 ;
RTS ;
xseedh DC.X "0.32"
xseedv DC.X "0.043"
;seedh DC.X "0.336"
;seedv DC.X "0.043"
real2 DC.X "1.0"
realn2 DC.X "-1.0"
sCons DC.X "50.0"
;bRect DC.W 50,675,392,1187
;bRect DC.W 40,646,475,1274
bRect DC.W 40,6,475,634
res DC.W 1
;limit DC.W 256
nolock DC.W 1
STRING PASCAL
wTitle DC.B 'Julia Sets v 5.1b0 - by Ray Sanders, Green Grass Software'
byA DC.B 'Written by Ray Sanders, Green Grass Software Inc.'
byB DC.B 'P.O.Box 570, Dunedin, Florida 34697-0570'
byC DC.B '(813) 796-2272'
blank DC.B ' '
ENDWITH
ENDMAIN
END